/**
 * @fileName webpack.config.js
 * @date 2022/2/9 9:15
 * @author yyx219
 * @email yyx219@qq.com
 * @github https://github.com/yyx219
 * @gitee https://gitee.com/yyx219
 * @PrivateNpm http://npm.hzbiz.net/
 */
"use strict"
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require("path");

module.exports = {
    entry:"./src/main.js",
    devServer:{
        static:"./public"
    },
    module: {
        rules: [
            {
                test: /\.(js|jsx)$/,
                exclude: /node_modules/,
                use: ['babel-loader']
            },
            {
                test: /\.(css|less)$/,
                use:["style-loader", "css-loader", "less-loader"]
            },
            {
                test: /\.svg$/,
                use: ['file-loader']
            }
        ]
    },
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'bundle.js',
    },
    resolve: {
        modules: ['node_modules'],
        alias: {
            "@": path.resolve(__dirname, './src')
        },
        extensions: [".js", ".json", ".jsx", ".scss",".svg"]
    },
    plugins:[
        new HtmlWebpackPlugin({
            title:"hello React",
            template:"./public/index.html",
            filename:"index.html"
        })
    ],
    mode:"development"
}